﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <base href="<%=basePath %>">
    <title>考勤首页</title>
    <link href="<%=basePath %>attend/frame/images/skin.css" rel="stylesheet" type="text/css" />
	<link href="<%=basePath %>attend/css/tab.css" rel="stylesheet" type="text/css" />
	<link href="<%=basePath %>attend/css/base.css" rel="stylesheet" type="text/css" />
	
	<script language="JavaScript" type="text/javascript" src="<%=basePath %>attend/js/lhgdialog/jquery-1.7.2.min.js"></script>
	<script language="javascript" type="text/javascript" src="<%=basePath %>attend/js/choose.js"></script>
	<script type="text/javascript" src="<%=basePath %>attend/js/lhgdialog/lhgdialog.min.js?skin=discuz"></script>
	
 	<script type="text/javascript">
		function reloadGo(sta) {
			var txtCurrentPage = document.getElementById("txtCurrentPage").value;
			var type = "^\\d+$";
			var re = new RegExp(type);
			if (txtCurrentPage.match(re) == null) {
				document.getElementById("txtCurrentPage").value="";
				$.dialog.alert('请输入整数!');
				return;
			}
			window.location.href = "MonthUser?sta="+sta+"&pagerMethod=go&currentPage=" + txtCurrentPage;
		}
		function confim(arg,arg1){
			var qstr = getCheckboxItem();
			if(qstr=="" && arg==0 && arg1 ==0){
				$.dialog.alert('请勾选后再确认！');
			}else{
				$.dialog.confirm('你确定考勤没问题吗？', function(){
					var s =document.getElementById("curPage").value;
					var ss =document.getElementById("status").value;
					if(arg1==0){
						window.location.href="Choose?qstr="+qstr+"&status="+ss+"&currentPage="+s;
					}else{
						window.location.href="Choose?qstr="+arg1+"&status="+ss+"&currentPage="+s;
					}
					$.dialog.tips('已确认！',1,'success.gif');
				}, function(){
				    $.dialog.tips('已取消！',1,'alert.gif');
				});
			}
		}
		function opdg(a,b){
		    $.dialog({ 
		    	lock: true,
		    	fixed:true,
		    	title: a+' 打卡详细记录',
		    	content:'url:<%=basePath %>attend/myattend/p.jsp?a='+a+'&b='+b,
		    	width: '500px',
				height: 380,
				max: false,
				min: false
		    });
		}
		function opens(userId,attId,today){
		    $.dialog({ 
		    	lock: true,
		    	fixed:true,
		    	title: today+' 考勤申诉', 
		    	content:'url:<%=basePath %>attend/myattend/winS.jsp?userId='+userId+'&attId='+attId,
		    	width: '600px',
				height: 350,
				max: false,
				min: false,
				close: function(){
			       this.reload();
			    },
			    /*okVal: '提交',
			    ok: function(){
			        //this.reload();
			        return false;
			    },*/
		    	cancelVal: '关闭',
				cancel: function(){
			        this.reload();
			    }
		    });
		}
	
	</script>
</head> 
  
  <body>
   		<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="<%=basePath %>attend/frame/images/mail_leftbg.gif"><img src="<%=basePath %>attend/frame/images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="<%=basePath %>attend/frame/images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31">
	        <div class="titlebt">
			      <c:if test="${Now==1}">本月考勤</c:if>
			      <c:if test="${Now==2}">上月考勤</c:if>
			      <c:if test="${Now==3}">近3月考勤</c:if>
			</div>
		</td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="<%=basePath %>attend/frame/images/mail_rightbg.gif"><img src="<%=basePath %>attend/frame/images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="<%=basePath %>attend/frame/images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
<!--    内嵌代码 Start-->
    <form action="Choose" name="cho" method="post">
    <input type="hidden" id="curPage" name="currentPage" value="${page.currentPage}"/>
    <input type="hidden" id="status" name="status" value="${Now}"/>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
	    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="15" height="30"><img src="<%=basePath %>attend/images/tab_03.gif" width="15" height="30" /></td>
	        <td background="<%=basePath %>attend/images/tab_05.gif" height="30" class="STYLE1"><jsp:include page="../message.jsp" flush="true"/></td>
	        </tr>
	    </table></td>
	        <td width="14"><img src="<%=basePath %>attend/images/tab_07.gif" width="14" height="30" /></td>
	  </tr>
	    </table></td>
	  </tr>
	  <tr>
	    <td>
	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="9" background="<%=basePath %>attend/images/tab_12.gif">&nbsp;</td>
	        <td bgcolor="#f3ffe3">
        <!--内嵌Table Start-->
	        <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#c0de98">
	          <tr align="middle">
	            <td width="5%" height="26" background="<%=basePath %>attend/images/tab_14.gif"><!-- <input id="checkOpp" type="checkbox" /> -->全选</td>
	            <td width="11%" background="<%=basePath %>attend/images/tab_14.gif">校  区</td>
	            <td width="10%" background="<%=basePath %>attend/images/tab_14.gif">星  期</td>
	            <td width="12%" background="<%=basePath %>attend/images/tab_14.gif">日  期</td>
	            <td width="10%" background="<%=basePath %>attend/images/tab_14.gif">上  班</td>
	            <td width="10%" background="<%=basePath %>attend/images/tab_14.gif">下  班</td>
	            <td width="10%" background="<%=basePath %>attend/images/tab_14.gif">状  态</td>
	            <td width="10%" background="<%=basePath %>attend/images/tab_14.gif">迟  到</td>
	            <td width="10%" background="<%=basePath %>attend/images/tab_14.gif">早  退</td>
	            <td width="12%" background="<%=basePath %>attend/images/tab_14.gif">操  作</td>
	          </tr>
	          <c:choose>
	          <c:when test="${leng!=0}">
		          <c:forEach items="${userlist}" var="userss">
		          <tr align="middle" bgColor="#ffffff" onMouseOver="this.bgColor='#cccccc';" onMouseOut="this.bgColor='#ffffff';">
		            <td height="25">
						<c:choose>
			            	<c:when test="${userss.attconfirm==5}"><input border="0" name="items" type="checkbox" value="${userss.attid}"></c:when>
			            	<c:otherwise><input type="checkbox" title="不可勾选" disabled="disabled"></c:otherwise>
		          		</c:choose>
					</td>
		            <td title="指纹所在校区">${userss.deptname}</td>
		            <td>
		            	<c:if test="${userss.attweek==1}"><font color="red">星期天</font></c:if>
		            	<c:if test="${userss.attweek==2}">星期一</c:if>
		            	<c:if test="${userss.attweek==3}">星期二</c:if>
		            	<c:if test="${userss.attweek==4}">星期三</c:if>
		            	<c:if test="${userss.attweek==5}">星期四</c:if>
		            	<c:if test="${userss.attweek==6}">星期五</c:if>
		            	<c:if test="${userss.attweek==7}"><font color="red">星期六</font></c:if>
	               </td>
		            <td>
			            <a href="javascript:void(0);" onclick="opdg('${userss.attdate}',${userss.userId});">${userss.attdate}</a>
	            	</td>
		            <td>${userss.attworktime}</td>
		            <td>${userss.attclosingtime}</td>
		            <td>
		            	<c:if test="${userss.attstate==1}"><font color="green">正常</font></c:if>
		            	<c:if test="${userss.attstate==2}"><font color="#CC0000">迟到</font></c:if>
		            	<c:if test="${userss.attstate==3}"><font color="#CC0099">早退</font></c:if>
		            	<c:if test="${userss.attstate==4}"><font color="#CC0099">调休</font></c:if>
		            	<c:if test="${userss.attstate==5}"><font color="#FF0000">旷工</font></c:if>
		            	<c:if test="${userss.attstate==6}"><font color="#0000FF">出差</font></c:if>
		            	<c:if test="${userss.attstate==7}"><font color="#F72056">婚假</font></c:if>
		            	<c:if test="${userss.attstate==8}"><font color="#FF6600">年假</font></c:if>
		            	<c:if test="${userss.attstate==9}"><font color="#000000">病假</font></c:if>
		            	<c:if test="${userss.attstate==10}"><font color="#000000">事假</font></c:if>
		            	<c:if test="${userss.attstate==11}"><font color="#000000">丧假</font></c:if>
		            	<c:if test="${userss.attstate==12}"><font color="#000000">产假</font></c:if>
		            	<c:if test="${userss.attstate==13}"><font color="#000000">陪产假</font></c:if>
	               </td>
		            <td>
			            <c:choose>
			            	<c:when test="${userss.attlatetime==0}"><font color="#FF3300">未迟到</font></c:when>
			            	<c:otherwise>${userss.attlatetime}<font color="#6666CC">分钟</font></c:otherwise>
		                </c:choose>
	                </td>
	                <td>
		                <c:choose>
			            	<c:when test="${userss.attearlytime==0}"><font color="#FF3300">未早退</font></c:when>
			            	<c:otherwise>${userss.attearlytime}<font color="#6666CC">分钟</font></c:otherwise>
		            	</c:choose>
	                </td>
	                <td>
		            	<c:if test="${userss.attconfirm==0}"><font color="red">处理中...</font></c:if>
		            	<c:if test="${userss.attconfirm==1}">[<font color="#999999">已确认</font></a>]</c:if>
		            	<c:if test="${userss.attconfirm==2}">[<font color="#666666">申诉中</font></a>]</c:if>
		            	<c:if test="${userss.attconfirm==3}">[<font color="#336600">申诉成功</font></a>]</c:if>
		            	<c:if test="${userss.attconfirm==4}">[<font color="#666666">已驳回</font></a>]</c:if>
		            	<c:if test="${userss.attconfirm==5}">[<a href="javascript:void(0);" onClick="confim(1,${userss.attid});"><font color="green">确认</font></a>]
		            	[<a href="javascript:void(0);" onclick="opens(${userss.userId},${userss.attid},'${userss.attdate}');"><font color="green">申诉</font></a>]</c:if>
		            	<%--[<a href="<%=basePath %>attend/myattend/appeal.jsp?status=${Now }&attID=${userss.attid}&ueId=${userss.userId}&currentPage=${page.currentPage}"><font color="green">申诉</font></a>]--%>
	                </td>
		          </tr>
		          </c:forEach>
	          	</c:when>
	          	<c:otherwise>
	          	<tr>
	            	<td height="25" bgcolor="#FFFFFF" align="center" colspan="10"><font color="red">无记录!</font></td>
	            </tr>
	          	</c:otherwise>
	          </c:choose>
	        </table>
<!-- 内嵌Table end-->
	        </td>
	        <td width="9" background="<%=basePath %>attend/images/tab_16.gif">&nbsp;</td>
	      </tr>
	    </table></td>
	  </tr>
	  <tr>
	    <td height="29"><table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="15" height="29"><img src="<%=basePath %>attend/images/tab_20.gif" width="15" height="29" /></td>
	        <td background="<%=basePath %>attend/images/tab_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
	          <tr>
	            <td width="25%" height="29" nowrap="nowrap">
<%--            <input type="hidden" id="nameA" name="hial"/>--%>
                <a href="javascript:void(0);" class="coolbg" id="checkAll">全选</a>
                <a href="javascript:void(0);" class="coolbg" id="checkOpp">反选</a>
                <a href="javascript:void(0);" class="coolbg" id="delAll">取消</a>
                <a href="javascript:void(0);" onclick="confim(0,0);" class="coolbg">一键确认</a>
               <!--  <input type="submit" class="coolbg" value="一键确认" id="SubmitID" onClick="return excuteDel()"/> -->
               &nbsp;&nbsp;&nbsp;&nbsp;
                <span class="STYLE1">共<font color="#FF0000">${page.totalRows}</font>条纪录，当前第<font color="#0066FF">${page.currentPage}</font>/共<font color="#0066FF">${page.totalPages}</font>页，每页<font color="#FF0000">${page.pageSize}</font>条纪录
                &nbsp;&nbsp;迟到统计分钟：<font color="#FF0000">${sum.sum}</font>分钟</span></td>
	            <td width="75%" valign="middle" class="STYLE1">
		            <div align="right">
			            <c:choose>
						    <c:when test="${page.totalRows<=page.pageSize}">
						    	<img border="0" src="<%=basePath %>attend/images/page/first_1.gif">&nbsp;<img border="0" src="<%=basePath %>attend/images/page/back_1.gif">&nbsp;&nbsp;<img border="0" src="<%=basePath %>attend/images/page/next_1.gif">&nbsp;<img border="0" src="<%=basePath %>attend/images/page/last_1.gif">&nbsp;&nbsp;<font color="#999999">转到</font><input type="text" disabled id="txtCurrentPage" size="3">页<input type="button" value="Go"/>&nbsp;&nbsp;
						    </c:when>
						    <c:when test="${page.currentPage==1}">
						    	<img border="0" src="<%=basePath %>attend/images/page/first_1.gif">&nbsp;<img border="0" src="<%=basePath %>attend/images/page/back_1.gif">&nbsp;&nbsp;<a href="MonthUser?pagerMethod=next&currentPage=${page.currentPage}&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/next.gif"></a>&nbsp;<a href="MonthUser?pagerMethod=last&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/last.gif"></a>&nbsp;&nbsp;转到<input type="text" title="请输入整数哦！" size="3" id="txtCurrentPage"/>页<input type="button" value="Go" onClick="reloadGo(sta='${Now}');"/>&nbsp;&nbsp;
						    </c:when>
						    <c:when test="${page.currentPage==page.totalPages}">
						    	<a href="MonthUser?pagerMethod=first&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/first.gif"></a>&nbsp;<a href="MonthUser?pagerMethod=previous&currentPage=${page.currentPage}&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/back.gif"></a>&nbsp;&nbsp;<img border="0" src="<%=basePath %>attend/images/page/next_1.gif">&nbsp;<img border="0" src="<%=basePath %>attend/images/page/last_1.gif">&nbsp;&nbsp;转到<input type="text" title="请输入整数哦！" size="3" id="txtCurrentPage"/>页</font><input type="button" value="Go" onClick="reloadGo(sta='${Now}');"/>&nbsp;&nbsp;
						    </c:when>
							<c:otherwise>
								<a href="MonthUser?pagerMethod=first&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/first.gif"></a>&nbsp;<a href="MonthUser?pagerMethod=previous&currentPage=${page.currentPage}&sta=sta"><img border="0" src="<%=basePath %>attend/images/page/back.gif"></a>&nbsp;
								<a href="MonthUser?pagerMethod=next&currentPage=${page.currentPage}&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/next.gif"></a>&nbsp;<a href="MonthUser?pagerMethod=last&sta=${Now}"><img border="0" src="<%=basePath %>attend/images/page/last.gif"></a>&nbsp;&nbsp;转到<input type="text" title="请输入整数哦！" size="3" id="txtCurrentPage"/>页<input type="button" value="Go" onClick="reloadGo(sta='${Now}');"/>&nbsp;&nbsp;
							</c:otherwise>
						</c:choose>
		            </div>
	            </td>
	          </tr>
	        </table></td>
	        <td width="14"><img src="<%=basePath %>attend/images/tab_22.gif" width="14" height="29" /></td>
	      </tr>
	    </table></td>
	  </tr>
	</table>
	</form>
	<!--内嵌代码 end-->
	</td>
    <td background="<%=basePath %>attend/frame/images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="<%=basePath %>attend/frame/images/mail_leftbg.gif"><img src="<%=basePath %>attend/frame/images/buttom_left2.gif" width="17" height="17"/></td>
    <td background="<%=basePath %>attend/frame/images/buttom_bgs.gif"><img src="<%=basePath %>attend/frame/images/buttom_bgs.gif" width="17" height="17"/></td>
    <td valign="bottom" background="<%=basePath %>attend/frame/images/mail_rightbg.gif"><img src="<%=basePath %>attend/frame/images/buttom_right2.gif" width="16" height="17"/></td>
  </tr>
</table>
</body>
</html>
